<?php
class NavigationHelper extends AppHelper{
	
	function getNavigation(){
		$menu = array(
			'Rollen' => array(
				'_attributes' => array(
						'link'=>'',
						'controller'=>'roles'
					),
				'Anlegen' => '/admin/roles/add'
			),
			'User' => array(
				'Anlegen' => '/admin/users/add'
			),
			'Unternehmen' => array(
				'Anlegen' => '/manager/companies/',
				'Verwalten' => '/manager/companies/',
				'Ansprechpartner' => array(
						'Anlegen' => '/manager/contactPersons/add',
				)
			)
		);
		return $menu;
	}
	
	function buildNavigation($menuArray,&$out) {
		$out .= '<ol>';
		foreach($menuArray as $key => $value){
			$out .= '<li>';
			if(is_array($value)){
				$out .= $key;
				$this->buildNavigation($value, $out);
			}else{
				$out .= '<a href="'.URL_PREFIX.$value.'">'.$key.'</a>';
			}
			
			$out .= '</li>';
		}
		
		$out .= "</ol>";
		return $this->output($out);
	}
	
	
}
?>
